<?php

require_once 'cms/content/om/om/BaseContent.php';


/**
 * Skeleton subclass for representing a row from the 'content' table.
 *
 * 
 *
 * You should add additional methods to this class to meet the
 * application requirements.  This class will only be generated as
 * long as it does not already exist in the output directory.
 *
 * @package cms.content.om
 */	
class Content extends BaseContent {

    function getMaxPosition() {

        $con = Propel::getConnection();
        $stmt = $con->createStatement();

        $rs = $stmt->executeQuery(
                "SELECT MAX(position) FROM content " .
                "WHERE category_id = ". $this->getCategoryId(),
                ResultSet::FETCHMODE_NUM
              );

        if($rs->next()) {
            return $rs->getInt(1);
        }
    }

} // Content
